<script setup lang="ts">
import type { NuxtError } from '#app'

defineProps({
  error: Object as () => NuxtError
})

const handleError = () => clearError({ redirect: '/' })
</script>

<template>
  <div>
    <h2>{{ error?.statusCode }}</h2>
    <h2>{{ error?.statusMessage }}</h2>
    <UButton @click="handleError">清除错误，返回首页</UButton>
  </div>
</template>
